<script setup>
import { ref } from 'vue'

// 获取当前年份
const currentYear = ref(new Date().getFullYear())
// 版本信息
const version = ref('0.0.1')
</script>

<template>
  <div class="footer-component">
    <div class="footer-container">
      <div class="footer-content">
        <div class="footer-section">
          <div class="footer-logo">ZhuDao OJ</div>
          <div class="footer-description">一个简洁高效的在线测评系统</div>
        </div>

        <div class="footer-section">
          <div class="footer-title">快速链接</div>
          <div class="footer-links">
            <a href="/home">主页</a>
            <a href="/about">关于我们</a>
          </div>
        </div>

        <div class="footer-section">
          <div class="footer-title">联系我们</div>
          <div class="footer-contact">
            <div>邮箱：aloda917@qq.com</div>
            <div>Gitee：<a href="https://gitee.com/littleorange917/orange-oj" target="_blank">@orangeoj</a></div>
          </div>
        </div>
      </div>

      <div class="footer-bottom">
        <div class="copyright">
          © {{ currentYear }} ZhuDao OJ. 保留所有权利
        </div>
        <div class="version">
          版本 v{{ version }}
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped>
.footer-component {
  width: 100%;
  background: var(--color-bg-2);
  padding: 40px 0 20px;
  margin-top: 40px;
  box-shadow: 0 -2px 8px rgba(16, 38, 57, 0.05);
}

.footer-container {
  width: 80%;
  margin: 0 auto;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.footer-section {
  margin-bottom: 20px;
  min-width: 200px;
}

.footer-logo {
  font-size: 20px;
  font-weight: bold;
  color: var(--color-text-1);
  margin-bottom: 10px;
}

.footer-description {
  color: var(--color-text-3);
  font-size: 14px;
  max-width: 300px;
}

.footer-title {
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--color-text-1);
}

.footer-links {
  display: flex;
  flex-direction: column;
}

.footer-links a, .footer-contact a {
  color: var(--color-text-2);
  margin-bottom: 8px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover, .footer-contact a:hover {
  color: rgb(var(--primary-6));
}

.footer-contact {
  color: var(--color-text-2);
  font-size: 14px;
}

.footer-contact div {
  margin-bottom: 8px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-3);
  font-size: 14px;
}

.version {
  font-size: 12px;
  background-color: var(--color-fill-2);
  padding: 4px 8px;
  border-radius: 12px;
}

@media screen and (max-width: 768px) {
  .footer-content {
    flex-direction: column;
  }

  .footer-section {
    margin-bottom: 30px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .version {
    margin-top: 10px;
  }
}
</style>
